<template>

    <h2>列表渲染</h2>
    <ol>
        <li v-for="item in namearr">{{ item }}</li>
    </ol>
    <ul>
        <li v-for="item in info">账号：{{ item.id }} 姓名：{{ item.name }} 年龄：{{ item.age }} 地址：{{ item.addr }}</li>
    </ul>    
</template>
<script setup lang="ts">
//声明数组并初始化数据
const namearr:string[]=["挂钩","都是","刚好","收到"]
//中括号代表数组
//花括号代表对象
const info=[
    {
        id:101,
        name:"张三",
        age:18,
        addr:"北京"
    },
    {
        id:102,
        name:"王五",
        age:18,
        addr:"天津"
    },
    {
        id:103,
        name:"李四",
        age:18,
        addr:"上海"
    }
];
</script>